﻿using nblTool.utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFirst.Entities;

namespace Jn698._45GWTool.Services
{
    public class MeterInfoService
    {
        public List<MeterInfo> Select()
        {
            return SqlSugarHelper.Db.Queryable<MeterInfo>().ToList();
        }

        public int Insert(MeterInfo m)
        {
            return SqlSugarHelper.Db.Insertable(m).ExecuteCommand();
        }
        public int Insert(List<MeterInfo> ms)
        {
            return SqlSugarHelper.Db.Insertable(ms).ExecuteCommand();
        }
        public int Update(MeterInfo m)
        {
            return SqlSugarHelper.Db.Updateable(m).ExecuteCommand();
        }

        public int Delete(MeterInfo m)
        {
            return SqlSugarHelper.Db.Deleteable<MeterInfo>().Where(item=>item.SeqNo==m.SeqNo).ExecuteCommand();
        }

        public bool Delete()
        {
            return SqlSugarHelper.Db.DbMaintenance.TruncateTable<MeterInfo>();
        }
    }
}
